/*
 * @Description: 
 * @Author: charles
 * @Date: 2021-11-15 12:02:25
 * @LastEditors: charles
 * @LastEditTime: 2021-11-15 12:17:52
 */
import {useEffect} from 'react'
import {connect} from 'dva'
function Article(props){
  const dispatch = props.dispatch;
  useEffect(() => {
    dispatch({type:'article/fetch',payload:{page:1,pageSize:10}})
  }, ['props.article']);

  return( 
    <div>
      <h2>资讯管理</h2>
      <ul>
        {
          props.article.list.map(item=>{
            return (
              <li key={item.id}>{item.title}</li>
            )
          })
        }
      </ul>
    </div>
  )
}
export default connect(state=>state)(Article);